Skip to main content

screenDepth

Type

function

Summary

Returns the bit depth of the screen.

Syntax

the screenDepth
screenDepth()

Description

Use the screenDepth function to determine the color capacity of the screen. For example, you might display different images depending on the number of colors available.

If the system has more than one monitor, the screenDepth function returns the bit depth of the main screen.

The expression

    2 ^ (the screenDepth)

is equal to

    the screenColors

The value returned by the screenDepth function is updated only when you start up the application. If you change the screen settings after starting up the application, you must quit and restart to update the screenDepth.

When the environment is "command line", the screenDepth is 0.

Examples

the screenDepth
if the screenDepth > 8 then show image "Photograph"

object: image

property: colorWorld, dontDither

control structure: function

function: environment, screenType

glossary: bit depth, return, application

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?